home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
nvlexp
/
password.frm
< prev
next >
Wrap
Text File
|
1995-12-05
|
5KB
|
158 lines
VERSION 2.00
Begin Form Password
Caption = "Enter UserID and Password"
ClientHeight = 3030
ClientLeft = 600
ClientTop = 660
ClientWidth = 5385
Height = 3435
Left = 540
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 3030
ScaleWidth = 5385
Top = 315
Width = 5505
Begin CommandButton Command2
Caption = "Cancel"
Height = 495
Left = 3300
TabIndex = 4
Top = 2490
Width = 855
End
Begin CommandButton Command1
Caption = "OK"
Height = 495
Left = 1380
TabIndex = 3
Top = 2490
Width = 855
End
Begin TextBox Text3
BorderStyle = 0 'None
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 13.5
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 360
Left = 2250
TabIndex = 2
Top = 1830
Width = 2025
End
Begin TextBox Text2
BorderStyle = 0 'None
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 13.5
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 360
Left = 2250
TabIndex = 1
Top = 1170
Width = 2025
End
Begin TextBox Text1
BorderStyle = 0 'None
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Left = 2250
TabIndex = 0
Top = 570
Width = 1725
End
End
DefInt A-Z
Dim TxthWnd As Integer, WindowLong As Long
Sub Command1_Click ()
TmpTxt$ = Text1.Text: Text1.Text = AllTrim(TmpTxt$)
TmpTxt$ = Text2.Text: Text2.Text = AllTrim(TmpTxt$)
TmpTxt$ = Text3.Text: Text3.Text = AllTrim(TmpTxt$)
If Text1.Text = "" Then
Txt$ = "You cannot have a blank user ID"
MsgBox Txt$, 32, "UserID"
Exit Sub
End If
If Text2.Text = "" Then
Txt$ = "You have a blank password. Is "
Txt$ = Txt$ + "this correct?"
Response% = MsgBox(Txt$, 36, "Password Warning")
If Response% = 7 Then ' Hit NO
Exit Sub
End If
End If
If Text2.Text = Text3.Text Then
MainForm.Hidden1.Text = UCase$(Text1.Text)
MainForm.Hidden2.Text = UCase$(Text2.Text)
Unload Password
Else
Txt$ = "Passwords do not match"
MsgBox Txt$, 32, "Passwords"
End If
End Sub
Sub Command2_Click ()
MainForm.Hidden1.Text = "***VOID***"
MainForm.Hidden2.Text = "***VOID***"
Unload Password
End Sub
Sub Form_Load ()
Form_Paint
End Sub
Sub Form_Paint ()
TmpTxt$ = "UserID: "
Password.CurrentX = Password.Text1.Left - TextWidth(TmpTxt$)
Password.CurrentY = Password.Text1.Top + 20
Password.Print TmpTxt$
TmpTxt$ = "Enter Password: "
Password.CurrentX = Password.Text2.Left - TextWidth(TmpTxt$)
Password.CurrentY = Password.Text2.Top
Password.Print TmpTxt$
TmpTxt$ = "Re-Enter Password: "
Password.CurrentX = Password.Text3.Left - TextWidth(TmpTxt$)
Password.CurrentY = Password.Text3.Top
Password.Print TmpTxt$
End Sub
Sub Text2_GotFocus ()
numChars = 14
dummy& = SendMessage(GetFocus(), EM_LIMITTEXT, numChars, ByVal 0&)
TxthWnd = GetFocus()
WindowLong = GetWindowLong(TxthWnd, GWL_STYLE)
WindowLong = WindowLong Or ES_PASSWORD
WindowLong = SetWindowLong(TxthWnd, GWL_STYLE, WindowLong)
WindowLong = SendMessage(TxthWnd, EM_SETPASSWORD, ASTERICK, ByVal 0&)
End Sub
Sub Text3_GotFocus ()
numChars = 14
dummy& = SendMessage(GetFocus(), EM_LIMITTEXT, numChars, ByVal 0&)
TxthWnd = GetFocus()
WindowLong = GetWindowLong(TxthWnd, GWL_STYLE)
WindowLong = WindowLong Or ES_PASSWORD
WindowLong = SetWindowLong(TxthWnd, GWL_STYLE, WindowLong)
WindowLong = SendMessage(TxthWnd, EM_SETPASSWORD, ASTERICK, ByVal 0&)
End Sub